import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/*配置路由*/
const router = new Router({
  mode: 'history',
  base: 'alatan/xzqh',
  routes: [
    {
      path: '/',
      name: 'xzqh',
      component: () => import('@/components/route/xzqh.vue'),
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('@/components/route/search.vue'),
    },
    {
      path: '/manager',
      name: 'manager',
      meta : {
        requireAuth:true
      },
      component: () => import('@/components/platform/platform_edit.vue'),
      children: [
        {
          path: '/manager/addnews',
          name: 'addnews',
          component:() => import('@/components/platform/edit/add_news.vue'),
          meta : {
            requireAuth:true
          },
        },
        {
          path: '/manager/editnews',
          name: 'editnews',
          component:() => import('@/components/platform/edit/edit_news.vue'),
          meta : {
            requireAuth:true
          },
        },
        {
          path: '/manager/editprops',
          name: 'editprops',
          component:() => import('@/components/platform/edit/edit_props.vue'),
          meta : {
            requireAuth:true
          },
        },
        {
          path: '/manager/editpois',
          name: 'editpois',
          component:() => import('@/components/platform/edit/edit_pois.vue'),
          meta : {
            requireAuth:true
          },
        },
        // {
        //   path: '/services/props',
        //   name: 'props',
        //   component:() => import('@/components/platform/services/detail_props.vue'),
        // },
        //其他路径
      ],
      redirect:'/manager/editprops'
    },


    {
      path: '/picshow',
      name: 'picshow', 
      component: () => import('@/components/platform/edit/picshow.vue'),
    },
    {
      path: '/contact',
      name: 'contact',
      component: () => import('@/components/route/contact.vue'),
    },
    
    
    // {
    //   path: '/home',
    //   name: 'home',
    //   component: () => import('@/components/route/home.vue'),
    // },
    
    {
      path: '/services',
      name: 'services',
      component: () => import('@/components/platform/platform_services.vue'),
      children: [
        {
          path: '/services/wfs',
          name: 'wfs',
          component:() => import('@/components/platform/services/detail_service.vue'),
        },
        {
          path: '/services/codes',
          name: 'codes',
          component:() => import('@/components/platform/services/detail_codes.vue'),
        },
        {
          path: '/services/props',
          name: 'props',
          component:() => import('@/components/platform/services/detail_props.vue'),
        },
      ],
      redirect:'/services/wfs'
    },
    
    {
      path: '/platform',
      name: 'platform',
      component: () => import('@/components/platform/null.vue'),
      children: [
        {
          path: '/platform/platformIntro',
          name: 'platformIntro',
          component:() => import('@/components/platform/null.vue'),
          children: [
            {
              path: '/platform/platformIntro/description',
              name: 'description',
              component: () => import('@/components/platform/platform_platformIntro_description.vue'), 
            },
            {
              path: '/platform/platformIntro/service',
              name: 'service',
              component: () => import('@/components/platform/platform_platformIntro_description.vue'), 
            },
            {
              path: '/platform/platformIntro/feature',
              name: 'feature',
              component: () => import('@/components/platform/platform_platformIntro_description.vue'), 
            },
            //description外的其他路径
            {
              path: '/',
              redirect:'/platform/platformIntro/description',
            },
            {
              path: '*',
              redirect:'/platform/platformIntro/description',
            },
          ],
          redirect:'/platform/platformIntro/description',
        },
        {
          path: '/platform/newsList', 
          name: 'newsList',
          component:() => import('@/components/platform/platform_newsList.vue'),
          children: [
            {
              path: '/platform/newsList/notic',
              name: 'notic',
              component:() => import('@/components/platform/null.vue'),
              children: [
                {
                  path: '/platform/newsList/notic/list',
                  name: 'noticlist',
                  component:() => import('@/components/platform/news_list.vue'),//components/platform/mews_list.vue
                },
                {
                  path: '/platform/newsList/notic/detail/:id',
                  name: 'noticdetail',
                  component:() => import('@/components/platform/detail.vue'),
                },
              ],
              redirect:'/platform/newsList/notic/list',
            },
            {
              path: '/platform/newsList/trend',
              name: 'trend',
              component:() => import('@/components/platform/null.vue'),
              children: [
                {
                  path: '/platform/newsList/trend/list',
                  name: 'trendlist',
                  component:() => import('@/components/platform/news_list.vue'),
                },
                {
                  path: '/platform/newsList/trend/detail/:id',
                  name: 'trenddetail',
                  component:() => import('@/components/platform/detail.vue'),
                },
              ],
              redirect:'/platform/newsList/trend/list',
            },
            {
              path: '/platform/newsList/media',
              name: 'media',
              component:() => import('@/components/platform/null.vue'),
              children: [
                {
                  path: '/platform/newsList/media/list',
                  name: 'medialist',
                  component:() => import('@/components/platform/news_list.vue'),
                },
                {
                  path: '/platform/newsList/media/detail/:id',
                  name: 'mediadetail',
                  component:() => import('@/components/platform/detail.vue'),
                },
              ],
              redirect:'/platform/newsList/media/list',

            },
            {
              path: '/platform/newsList/change',
              name: 'change',
              component:() => import('@/components/platform/null.vue'),
              children: [
                {
                  path: '/platform/newsList/change/list',
                  name: 'changelist',
                  component:() => import('@/components/platform/news_list.vue'),
                },
                {
                  path: '/platform/newsList/change/detail/:id',
                  name: 'changedetail',
                  component:() => import('@/components/platform/detail.vue'),
                },
              ],
              redirect:'/platform/newsList/change/list',
            },
          ],
        }
      ],
      redirect:'/platform/newsList/change/list'
    },
    {
      path: '*',
      redirect:'/'
    },
    
  ]
});
export default router;